package cn.edu.scau.cmi.luochenghao.chapter10;
import java.io.*;
public class Example10_7 {

	public static void main(String args[]) {
		
		File file = new File("/Users/luochenghao/git/201725110111_luo_chenghao/201725110111罗铖昊/Student.txt");
		String [] content = {"商品列表：","电视机,2567元/台","洗衣机,3562元/台","冰箱,6573元/台"};
		try {
			FileWriter outOne = new FileWriter(file);
			BufferedWriter outTwo = new BufferedWriter(outOne);
			for (String str:content) {
				outTwo.write(str);
				outTwo.newLine();
			}
			outTwo.close();
			outOne.close();
			FileReader inOne = new FileReader(file);
			BufferedReader inTwo = new BufferedReader(inOne);
			String s = null;
			while ((s = inTwo.readLine()) != null) {
				System.out.println(s);
			}
			inTwo.close();
			inOne.close();
		}catch(IOException e) {
			System.out.println(e);
		}
	}

}
